//
//  OtherCitIesCell.m
//  Lovelife
//
//  Created by dllo on 15/4/25.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "OtherCitIesCell.h"
#import "NightManager.h"
@implementation OtherCitIesCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.layer.borderWidth = 1;
        self.layer.borderColor = [UIColor grayColor].CGColor;
        self.layer.shadowColor = [UIColor blackColor].CGColor;
        self.layer.shadowOffset = CGSizeMake(2, 2);
        
        self.photo = [[UIImageView alloc]init];
        [self addSubview:self.photo];
        [_photo release];
        
        self.nameLabel = [[BaseLabel alloc]init];
        self.nameLabel.textColor = [UIColor whiteColor];
        self.nameLabel.numberOfLines = 0;
        self.nameLabel.font = [UIFont systemFontOfSize:15];
        [self addSubview:self.nameLabel];
        [_nameLabel release];
    
        self.sceneryLabel = [[BaseLabel alloc]init];
        self.sceneryLabel.numberOfLines = 0;
        self.sceneryLabel.textColor = [UIColor grayColor];
        self.sceneryLabel.font = [UIFont systemFontOfSize:15];
        [self addSubview:self.sceneryLabel];
        [_sceneryLabel release];
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.photo.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height / 2);
    self.nameLabel.frame = CGRectMake(0, self.photo.frame.size.height - 40, self.frame.size.width, 40);
    self.sceneryLabel.frame = CGRectMake(0, self.photo.frame.size.height + 20, self.frame.size.width, self.frame.size.height / 2 - 20);
}
- (void)setNightDayModel
{
    [NightManager setLabelColorWithLabel:self.sceneryLabel];
    [NightManager setBackgroundColorWithView:self];
}
- (void)setLightDayModel
{
    [NightManager setLabelColorWithLabel:self.sceneryLabel];
    [NightManager setBackgroundColorWithView:self];

}
- (void)dealloc
{
    [_photo release];
    [_nameLabel release];
    [_sceneryLabel release];
    [super dealloc];
}

@end
